<!DOCTYPE html>
<html>
<head>
<title>添加文章</title>
[#include "/WEB-INF/admin/include/common.html"]
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>添加文章</h5>
            </div>
           <form id="inputForm" action="save" method="post">
                <div class="ibox-content">
                    <div class="form-horizontal clearfix">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">标题：</label>
                            <div class="col-sm-3">
                                <input placeholder="标题" class="form-control" type="text" name="title">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">分类：</label>
                            <div class="col-sm-3">
                               <select class="form-control" name="articleCategoryId">
                                    [#list articleCategoryTree as category]
			                            <option value="${category.id}">
			                                [#if category.grade != 0]
			                                    [#list 1..category.grade as i]
			                                        &nbsp;&nbsp;
			                                    [/#list]
			                                [/#if]
			                                ${category.name}
			                            </option>
			                        [/#list]
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">作者：</label>
                            <div class="col-sm-3">
                                <input placeholder="作者" class="form-control" type="text" name="author">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">设置：</label>
                            <div class="col-sm-3">
                                <div class="checkbox">
                                   <label class="m-r"><input type="checkbox" name="isPublication" value="true" checked/>发布</label>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">内容：</label>
                            <div class="col-sm-8">
                               <textarea id="content" name="content" class="ibox-content no-padding" style="height: 250px;"></textarea>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer col-sm-3 col-sm-offset-2">
                    <button type="submit" class="btn btn-w-m btn-primary">确定</button>
                    <button type="button" class="btn btn-w-m btn-default" onclick="history.back(); return false;">取消</button>
                </div>
            </form>
        </div>
    </div>
</body>
</html>
<script type="text/javascript">
$().ready(function() {

    var $inputForm = $("#inputForm");
    var $content = $("#content");
    
    $content.editor();
    
    // 表单验证
    $inputForm.validate({
        rules: {
            "title": "required",
            "articleCategoryId": "required"
        }
    });

});
</script>